home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / hity wydania / Ubuntu 9.10 PL / karmelkowy-koliberek-9.10-netbook-remix-PL.iso / casper / filesystem.squashfs / usr / lib / python2.6 / lib2to3 / pygram.pyc (.txt) < prev    next >
Python Compiled Bytecode  |  2009-11-11  |  1KB  |  26 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.6)
  3.  
  4. '''Export the Python grammar and symbols.'''
  5. import os
  6. from pgen2 import token
  7. from pgen2 import driver
  8. from  import pytree
  9. _GRAMMAR_FILE = os.path.join(os.path.dirname(__file__), 'Grammar.txt')
  10.  
  11. class Symbols(object):
  12.     
  13.     def __init__(self, grammar):
  14.         """Initializer.
  15.  
  16.         Creates an attribute for each grammar symbol (nonterminal),
  17.         whose value is the symbol's type (an int >= 256).
  18.         """
  19.         for name, symbol in grammar.symbol2number.iteritems():
  20.             setattr(self, name, symbol)
  21.         
  22.  
  23.  
  24. python_grammar = driver.load_grammar(_GRAMMAR_FILE)
  25. python_symbols = Symbols(python_grammar)
  26.